package cn.iocoder.yudao.module.wine.dal.mysql.agreement;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wine.dal.dataobject.agreement.AgreementDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.agreement.vo.*;

/**
 * 协议配置 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface AgreementMapper extends BaseMapperX<AgreementDO> {

    default PageResult<AgreementDO> selectPage(AgreementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AgreementDO>()
                .eqIfPresent(AgreementDO::getContent, reqVO.getContent())
                .eqIfPresent(AgreementDO::getType, reqVO.getType())
                .betweenIfPresent(AgreementDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AgreementDO::getId));
    }

}